//
//  CommonStaticCell.m
//  HonlivApp
//
//  Created by admin on 2017/6/25.
//  Copyright © 2017年 honliv. All rights reserved.
//

#import "CommonStaticCell.h"
@interface CommonStaticCell()

@property (nonatomic,weak) UILabel *titLab;

@property (nonatomic,weak) UIImageView *iconView;

@end

@implementation CommonStaticCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        UIImageView *imgV = [[UIImageView alloc] initWithFrame:CGRectMake(5, 13, 24, 24)];
        [self.contentView addSubview:imgV];
        self.iconView = imgV;
        
        UILabel *titLab = [Factory createLabelWithFrame:CGRectMake(imgV.right+8, 0, 100, 50)];
        titLab.font = kFont(16);
        [self.contentView addSubview:titLab];
        self.titLab = titLab;
    }
    
    return self;
}
-(void)setDic:(NSDictionary *)dic{
    self.iconView.image = [UIImage imageNamed:dic[@"icon"]];
    self.titLab.text = dic[@"title"];
}
+(instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *cellId = @"cellId";
    CommonStaticCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
    if (cell == nil) {
        cell = [[CommonStaticCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId];
    }
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    return cell;
    
}

@end
